﻿<%@ Control Language="C#" Inherits="PlexBB.Controls.Admin.ModuleManagement.AcpModuleEdit" %>
<a name="maincontent"></a>

<script type="text/javascript">
    // <![CDATA[
    function display_options(value) {
        var mo = $('#<%=gModOptions.ClientID %>');
        value == 'category' ? mo.hide() : mo.show();
    }

    //		function display_modes(value)
    //		{
    //			// Find the old select tag
    //			var item = document.getElementById('module_mode');

    //			// Create the new select tag
    //			var new_node = document.createElement('select');
    //			new_node.setAttribute('id', 'module_mode');
    //			new_node.setAttribute('name', 'module_mode');

    //			// Substitute it for the old one
    //			item.parentNode.replaceChild(new_node, item);

    //			// Reset the variable
    //			item = document.getElementById('module_mode');

    //			var j = 0;
    //<!-- BEGIN m_names -->
    //		
    //			if (value == '{m_names.A_NAME}')
    //			{
    //	<!-- BEGIN modes -->
    //				item.options[j] = new Option('{m_names.modes.A_VALUE}');
    //				item.options[j].value = '{m_names.modes.A_OPTION}';
    //				j++;
    //	<!-- END modes -->
    //			}
    //<!-- END m_names -->

    //			// select first item
    //			item.options[0].selected = true;
    //		}

    // ]]>
</script>

<asp:HyperLink runat="server" ID="hBack" CssClass="flowEnd" Text="<%$ Lang:BACK:&amp;laquo; {0} %>" />
<h1>
    <asp:Literal runat="server" Text="<%$ Lang:TITLE%>" />
    ::
    <asp:Literal runat="server" ID="tModuleName" /></h1>
<p>
    <asp:Literal runat="server" Text="<%$ Lang:EDIT_MODULE_EXPLAIN%>" /></p>
<%--<div class="errorbox" runat="server" id="cErrorBox">
    <h3>
        <asp:Literal runat="server" Text="<%$ Lang:WARNING%>" /></h3>
    <p>
        <asp:Literal runat="server" ID="tError" /></p>
</div>--%>
<asp:ValidationSummary runat="server" ID="wValidationSummary" CssClass="errorbox"
    HeaderText="<%$ Lang:WARNING:<h3>{0}</h3>%>" ValidationGroup="ModuleEdit" />
<fieldset>
    <legend>
        <asp:Literal runat="server" Text="<%$ Lang:GENERAL_OPTIONS%>" /></legend>
    <dl>
        <dt>
            <asp:Label runat="server" AssociatedControlID="tModuleLangName" Text="<%$ Lang:MODULE_LANGNAME:{0}:%>" /><br />
            <asp:Label runat="server" Text="<%$ Lang:MODULE_LANGNAME_EXPLAIN%>" />
        </dt>
        <dd>
            <asp:TextBox runat="server" ID="tModuleLangName" CssClass="text medium" />
            <asp:RequiredFieldValidator runat="server" ID="vModuleLangName" ControlToValidate="tModuleLangName"
                Display="None" ErrorMessage="<%$ Lang:NO_MODULE_LANGNAME%>" ValidationGroup="ModuleEdit" />
        </dd>
    </dl>
    <dl>
        <dt>
            <asp:Label runat="server" AssociatedControlID="sModuleType" Text="<%$ Lang:MODULE_TYPE:{0}:%>" /></dt>
        <dd>
            <asp:DropDownList runat="server" ID="sModuleType" onchange="display_options(this.value);">
                <asp:ListItem Text="<%$ Lang:CATEGORY%>" Value="category" />
                <asp:ListItem Text="<%$ Lang:MODULE%>" Value="module" />
            </asp:DropDownList>
        </dd>
    </dl>
    <dl>
        <dt>
            <asp:Label runat="server" AssociatedControlID="sModuleParentID" Text="<%$ Lang:PARENT:{0}:%>" /></dt>
        <dd>
            <asp:DropDownList runat="server" ID="sModuleParentID" />
        </dd>
    </dl>
    <hr />
    <%--<dl>
		<dt><label for="module_type"><%= L_MODULE_TYPE %>:</label></dt>
		<dd><select name="module_type" id="module_type" onchange="display_options(this.value);"><option value="category"<!-- IF S_IS_CAT --> selected="selected"<!-- ENDIF -->><%= L_CATEGORY %></option><option value="module"<!-- IF not S_IS_CAT --> selected="selected"<!-- ENDIF -->><%= L_MODULE %></option></select></dd>
	</dl>
	<dl>
		<dt><label for="parent_id"><%= L_PARENT %>:</label></dt>
		<dd><select name="module_parent_id" id="parent_id"><%= S_CAT_OPTIONS %></select></dd>
	</dl>
	<hr />--%>
    <dl>
        <dt>
            <asp:Label runat="server" AssociatedControlID="sModuleEnabled" Text="<%$ Lang:MODULE_ENABLED:{0}:%>" /></dt>
        <dd>
            <asp:RadioButtonList runat="server" ID="sModuleEnabled" CssClass="radio" RepeatDirection="Horizontal"
                RepeatLayout="Flow">
                <asp:ListItem Value="True" Text="<%$ Lang:YES: {0}%>" />
                <asp:ListItem Value="False" Text="<%$ Lang:NO: {0}%>" />
            </asp:RadioButtonList>
        </dd>
    </dl>
    <%--<dl>
		<dt><label for="module_enabled"><%= L_MODULE_ENABLED %>:</label></dt>
		<dd><label><input type="radio" class="radio" name="module_enabled" id="module_enabled" value="1"<!-- IF MODULE_ENABLED --> checked="checked"<!-- ENDIF --> /> <%= L_YES %></label>
			<label><input type="radio" class="radio" name="module_enabled" value="0"<!-- IF not MODULE_ENABLED --> checked="checked"<!-- ENDIF --> /> <%= L_NO %></label></dd>
	</dl>--%>
    <div id="gModOptions" runat="server">
        <dl>
            <dt>
                <asp:Label runat="server" AssociatedControlID="sModuleDisplayed" Text="<%$ Lang:MODULE_DISPLAYED:{0}:%>" /><br />
                <asp:Label runat="server" Text="<%$ Lang:MODULE_DISPLAYED_EXPLAIN%>" />
            </dt>
            <dd>
                <asp:RadioButtonList runat="server" ID="sModuleDisplayed" CssClass="radio" RepeatDirection="Horizontal"
                    RepeatLayout="Flow">
                    <asp:ListItem Value="true" Text="<%$ Lang:YES: {0}%>" />
                    <asp:ListItem Value="false" Text="<%$ Lang:NO: {0}%>" />
                </asp:RadioButtonList>
            </dd>
        </dl>
        <dl>
            <dt>
                <asp:Label runat="server" AssociatedControlID="sChooseModule" Text="<%$ Lang:CHOOSE_MODULE:{0}:%>" /><br />
                <asp:Label runat="server" Text="<%$ Lang:CHOOSE_MODULE_EXPLAIN%>" />
            </dt>
            <dd>
                <asp:DropDownList runat="server" ID="sChooseModule" AutoPostBack="true" />
            </dd>
        </dl>
        <dl>
            <dt>
                <asp:Label runat="server" AssociatedControlID="sChooseMode" Text="<%$ Lang:CHOOSE_MODE:{0}:%>" /><br />
                <asp:Label runat="server" Text="<%$ Lang:CHOOSE_MODE_EXPLAIN%>" />
            </dt>
            <dd>
                <asp:DropDownList runat="server" ID="sChooseMode" />
            </dd>
        </dl>
    </div>
    <p class="submit-buttons">
        <asp:Button runat="server" ID="bModuleSubmit" CssClass="button1" Text="<%$ Lang:SUBMIT%>"
            ValidationGroup="ModuleEdit" />&nbsp;
        <input class="button2" type="reset" id="reset" runat="server" name="reset" value="<%$ Lang:RESET%>" />
    </p>
    <%--<div id="modoptions"<!-- IF S_IS_CAT --> style="display: none;"<!-- ENDIF -->>
		<dl>
			<dt><label for="module_display"><%= L_MODULE_DISPLAYED %>:</label><br /><span><%= L_MODULE_DISPLAYED_EXPLAIN %></span></dt>
			<dd><label><input type="radio" class="radio" name="module_display" id="module_display" value="1"<!-- IF MODULE_DISPLAY --> checked="checked"<!-- ENDIF --> /> <%= L_YES %></label>
				<label><input type="radio" class="radio" name="module_display" value="0"<!-- IF not MODULE_DISPLAY --> checked="checked"<!-- ENDIF --> /> <%= L_NO %></label></dd>
		</dl>
		<dl>
			<dt><label for="module_basename"><%= L_CHOOSE_MODULE %>:</label><br />
			<span><%= L_CHOOSE_MODULE_EXPLAIN %></span></dt>
			<dd><select name="module_basename" id="module_basename" onchange="display_modes(this.value);"><%= S_MODULE_NAMES %></select></dd>
		</dl>
		<dl>
			<dt><label for="module_mode"><%= L_CHOOSE_MODE %>:</label><br />
			<span><%= L_CHOOSE_MODE_EXPLAIN %></span></dt>
			<dd><select name="module_mode" id="module_mode"><%= S_MODULE_MODES %></select></dd>
		</dl>
	</div>

	<p class="submit-buttons">
		<input type="hidden" name="action" value="{ACTION}" />
		<input type="hidden" name="m" value="{MODULE_ID}" />
		
		<input class="button1" type="submit" id="submit" name="submit" value="<%= L_SUBMIT %>" />&nbsp;
		<input class="button2" type="reset" id="reset" name="reset" value="<%= L_RESET %>" />
	</p>--%>
</fieldset>
